package com.gxa.hualian.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.*;


//@Getter @Setter     // 生成getter和setter
//@ToString   // 生成重写后的toString+

@Data       // 包含@Getter @Setter @ToString
@AllArgsConstructor     // 生成全参构造
@NoArgsConstructor  // 生成空参构造
/**
 * 使用lombok插件简化实体类的设计
 * 1.添加lombok的jar依赖
 * 2.在idea配置lombok插件
 * @Author ChenJin
 * @date 2021/10/12 15:50
 * Description:
 **/
public class User implements Serializable {
    private Long id;
    private String name;
    private String phone;
    private Integer points;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Timestamp regTime;


    /**
     * 用户兑换优惠券的情况：一对多，使用List
     */
    List<Get> getList = new ArrayList<>(16);

    List<Coupon> getCpnList = new ArrayList<>(16);

    private List<String> list;

    public List<String> getList() {
        if (null == list) {
            list = new ArrayList<>(16);
        }
        return list;
    }

    private List<String> array;

    public List<String> getArray() {
        if (null == array) {
            array = new ArrayList<>(16);
        }
        return array;
    }

    private Set<String> set;

    public Set<String> getSet() {
        if (null == set) {
            set = new HashSet<>(16);
        }
        return set;
    }

    private Map<String, String> map;

    public Map<String, String> getMap() {
        if (null == map) {
            map = new HashMap<>(16);
        }
        return map;
    }
}
